package com.nowcoder.code.hjnc;

import com.algorithm.model.ListNode;

public class NC78 {

    public ListNode ReverseList(ListNode head) {

        ListNode pre = null;
        ListNode tmp;
        while (head != null) {
            tmp = head;
            head = head.next;
            tmp.next = pre;
            pre = tmp;
        }

        return pre;
    }

}
